/**
 * @version $Id$
 */
package org.spacegame.common;

import java.io.Serializable;
import java.net.SocketAddress;
import java.util.EventObject;

/**
 * The event that an object is received.
 * 
 * @author vincent
 * 
 */
public class ObjectReceivedEvent extends EventObject {

	/**
	 * The serial version UID.
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * The received object.
	 */
	private final Serializable object;

	/**
	 * The address of the peer.
	 */
	private final SocketAddress remoteAddress;

	/**
	 * Construct a new event.
	 * 
	 * @param source
	 */
	public ObjectReceivedEvent(final Object source, final Serializable object, final SocketAddress remoteAddress) {
		super(source);
		this.object = object;
		this.remoteAddress = remoteAddress;
	}

	/**
	 * @return the object
	 */
	public Serializable getObject() {
		return object;
	}

	/**
	 * @return the remoteAddress
	 */
	public SocketAddress getRemoteAddress() {
		return remoteAddress;
	}

}
